<template>
    <lightning-card title="NavToRelatedList" icon-name="custom:custom96">
        <template lwc:if={account.data}>
            <div class="slds-var-m-around_medium">
                Example Account:
                <p>{account.data.Name}</p>
                <p>{account.data.Type}</p>
                <p class="slds-var-m-bottom_small">
                    <lightning-formatted-phone
                        value={account.data.Phone}
                    ></lightning-formatted-phone>
                </p>
                <lightning-button
                    label="Go to Related Contacts list"
                    onclick={navigateToRelatedList}
                ></lightning-button>
            </div>
        </template>
        <template lwc:elseif={account.error}>
            <c-error-panel errors={account.error}></c-error-panel>
        </template>
        <c-view-source source="lwc/navToRelatedList" slot="footer">
            Navigate to a related list. In this example, Related Contacts.
        </c-view-source>
    </lightning-card>
</template>
